package com.hxzy.order.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author wy
 * @Description 开启服务负载均衡选择拦截器
 * @Date 2023/12/12 15:01
 * @Version 1.0
 */
@Configuration
public class RestTemplateConfig {

    /**
     * 开始负载均衡拦截器
     * @return
     */
    @LoadBalanced
    @Bean
    public RestTemplate  restTemplate(){
        return new RestTemplate();
    }
}
